﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CVM.Core.Entities;

namespace CVM.View.UserControls
{
    public partial class GridCandidates : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        
        public List<Candidate> ListModified
        {
            get
            {
                if(ViewState["ListModified"] == null)
                    ViewState["ListModified"] = new List<Candidate>();

                return (List<Core.Entities.Candidate>) ViewState["ListModified"];
            }
            set { ViewState["ListModified"] = value; }

        }

       

        protected void grdCandidates_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row = grdCandidates.Rows[index];

            switch (e.CommandName)
            {
                case "Modified":
                    row.BackColor = System.Drawing.Color.Yellow;
                    break;
                case "Delete":
                    row.BackColor = System.Drawing.Color.Red;
                    break;
            }
        }
    }
}